<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: FX95
  Date: 2022/12/6
  Time: 22:12
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/bootstrap.css">
    <style>

        p{
            font-family: "宋体","仿宋",sans-serif;/*若电脑不支持宋体，则用仿宋，若不支持仿宋，则在sans-serif中找*/
            font-weight: bold;
            font-size: 200%;
            font-style: italic;

            opacity: 0.5;/*字体的透明度：1：默认样式，0：全透明*/
        }
    </style>
</head>

<body>
<div class="container">
  <table class="table table-striped" >
     <p align="center">订单详情</p>
       <tr>
           <td>序号</td>
           <td>菜名</td>
           <td>单位</td>
           <td>价格</td>
           <td>数量</td>
           <td>总价</td>
       </tr>

      <c:forEach items="${orderItems}" var="orderItem" varStatus="status">

          <tr>
               <td>${status.count}</td>
             <td>${orderItem.goodsName}</td>
              <td>${orderItem.unit}</td>
              <td>${orderItem.price}</td>
              <td>${orderItem.count}</td>
              <td>${orderItem.subTotal}</td>
          </tr>
      </c:forEach>

      <c:set var="sum" value="0"></c:set>


          <c:forEach items= "${orderItems}" var="row" varStatus="status">
              <c:set var="sum"  value="${sum+(row.subTotal)}"/>
          </c:forEach>


  </table>
  <div align="right">
      合计:<font color="red">

      ${sum}
  </font>元
  </div>

</div>




</body>
</html>
